/* 右侧工具栏主容器 */
.right-toolbar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px 0 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  border-radius: 20px;
  width: 50px;
}

/* 主工具栏区域 */
.toolbar-main {
  display: flex;
  flex-direction: column;
  gap: -10px;
  border-radius: 20px;
}

/* 工具栏项 */
.toolbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  border-radius: 20px;
  height: 50px;
}

.toolbar-item:hover {
  background-color: #f5f5f5;
}

/* 工具栏图标 */
.toolbar-icon {
  font-size: 20px;
  margin-bottom: 5px;
  position: relative;
}

/* 工具栏文本 */
.toolbar-text {
  font-size: 5px;
  color: #666;
}

/* 未读消息徽章 */
.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff4d4f;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 返回顶部按钮 */
.back-to-top {
  margin-top: 12px;
  padding: 10px -12px;
  background-color: #fff;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.back-to-top:hover {
  background-color: #f5f5f5;
}

.back-to-top span {
  font-size: 10px;
  color: #666;
}

/* 消息中心样式 */
.message-center {
  position: absolute;
  right: 100%;
  top: 0;
  width: 300px;
  background-color: #fff;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  border-radius: 4px 0 0 4px;
  overflow: hidden;
}

.message-header {
  padding: 12px 15px;
  background-color: #1890ff;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-actions {
  display: flex;
  gap: 10px;
}

.mark-all-read, .close-message {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
}

.mark-all-read:hover, .close-message:hover {
  text-decoration: underline;
}

.message-content {
  max-height: 400px;
  overflow-y: auto;
}

.empty-message {
  padding: 30px 20px;
  text-align: center;
  color: #999;
}

.empty-message p {
  margin-bottom: 15px;
}

.message-list {
  padding: 10px;
}

.message-item {
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.message-item.unread {
  background-color: #f6fbff;
}

.message-item h4 {
  font-size: 14px;
  margin-bottom: 5px;
  color: #333;
}

.message-item p {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  line-height: 1.4;
}

.message-time {
  font-size: 10px;
  color: #999;
  display: block;
  text-align: right;
}

.view-all {
  display: block;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: #1890ff;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  margin-top: 10px;
}

.view-all:hover {
  text-decoration: underline;
}

/* 客服面板样式 */
.chat-panel {
  position: absolute;
  right: 100%;
  top: 0;
  width: 320px;
  background-color: #fff;
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  border-radius: 4px 0 0 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 500px;
}

.chat-header {
  padding: 12px 15px;
  background-color: #1890ff;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

.chat-content {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background-color: #f5f5f5;
}

.service-offline, .empty-chat {
  text-align: center;
  color: #999;
  padding: 30px 20px;
}

.service-offline p, .empty-chat p {
  margin-bottom: 10px;
}

.chat-message {
  margin-bottom: 15px;
  display: flex;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.service {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 4px;
  position: relative;
}

.user .message-bubble {
  background-color: #1890ff;
  color: white;
  border-top-right-radius: 0;
}

.service .message-bubble {
  background-color: white;
  color: #333;
  border-top-left-radius: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.message-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  display: block;
  text-align: right;
  margin-top: 4px;
}

.service .message-time {
  color: #999;
}

.chat-input {
  padding: 10px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input textarea {
  flex: 1;
  height: 60px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: none;
  font-size: 14px;
}

.chat-input textarea:focus {
  outline: none;
  border-color: #1890ff;
}

.chat-input button {
  padding: 8px 15px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.chat-input button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.chat-footer {
  padding: 15px;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.service-info {
  margin-bottom: 15px;
}

.service-info h4 {
  font-size: 14px;
  margin-bottom: 5px;
  color: #333;
}

.service-info p {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.service-options {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.service-options button {
  padding: 4px 8px;
  font-size: 12px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 2px;
  cursor: pointer;
}

.service-options button:hover {
  background-color: #e6e6e6;
}

.quick-links {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.quick-links a {
  font-size: 12px;
  color: #1890ff;
  text-decoration: none;
}

.quick-links a:hover {
  text-decoration: underline;
}